home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / telecomm / sticpsrc.lzh / SOURCE.ARC / FTP.H < prev    next >
C/C++ Source or Header  |  1989-12-25  |  2KB  |  56 lines

  1. #define CTLZ    26        /* EOF for CP/M systems */
  2.  
  3. extern char USERFILE[]; /* List of user names and permissions */
  4.  
  5. #define MAXPATH 8        /* maximal number of path/permission pairs */
  6.  
  7. /* Description of a list of files */
  8. struct ftp_list {
  9.     struct ftp_list *next;    /* Linked list pointer */
  10.     int isdir;        /* Is it a directory? (vs a file) */
  11.     char localname[1];    /* Local name of the file */
  12. };
  13.  
  14. #define NULLFTPLIST (struct ftp_list *)0
  15.  
  16. /* Per-session control block */
  17. struct ftp {
  18.     struct ftp *prev;    /* Linked list pointers */
  19.     struct ftp *next;
  20.     struct tcb *control;    /* TCP control connection */
  21.     char state;
  22. #define COMMAND_STATE    0    /* Awaiting user command */
  23. #define SENDING_STATE    1    /* Sending data to user */
  24. #define RECEIVING_STATE 2    /* Storing data from user */
  25.  
  26.     char type;        /* Transfer type */
  27. #define IMAGE_TYPE    0
  28. #define ASCII_TYPE    1
  29.  
  30.     FILE *fp;        /* File descriptor being transferred */
  31.     struct socket port;    /* Remote port for data connection */
  32.     struct tcb *data;    /* Data connection */
  33.  
  34.     /* The following are used only by the server */
  35.     char *username;        /* Arg to USER command */
  36.     char *path[MAXPATH];    /* Allowable path prefix */
  37.     char perms[MAXPATH];    /* Permission flag bits */
  38. #define FTP_READ    1    /* Read files */
  39. #define FTP_CREATE    2    /* Create new files */
  40. #define FTP_WRITE    4    /* Overwrite or delete existing files */
  41.  
  42.     char *buf;        /* Input command buffer */
  43.     char cnt;        /* Length of input buffer */
  44.     char *cd;        /* Current directory name */
  45.     char *filename;        /* "current filename" for XATR/rename */
  46.  
  47.     /* And these are used only by the client */
  48.     struct session *session;
  49.     struct ftp_list *ftp_list; /* Files to send using "tput" */
  50.     int xatr;        /* XATR option on? */
  51.     struct timer xfertime;    /* Timer for current transfer */
  52. };
  53.  
  54. #define NULLFTP (struct ftp *)0
  55.  
  56.